package com.ch.dream.asynctask;

import org.json.JSONObject;

import android.content.Context;

import com.ch.dream.base.BaseRequestAsyncTask;
import com.ch.dream.bean.UserinfoBean;
import com.ch.dream.common.CommonRequestUrl;
import com.ch.dream.net.MyHttpAPI;

public class LoginRequestAsyncTask extends BaseRequestAsyncTask{

	private MyHttpAPI myHttpAPI = new MyHttpAPI(CommonRequestUrl.LOGIN);
	
	public LoginRequestAsyncTask(Context context, RequestServerListener requestServerListener) {
		super(context, requestServerListener);
	}

	@Override
	protected Object doInBackground(Object... params) {
		
		JSONObject jsonObject = null;
		try{
			UserinfoBean bean =(UserinfoBean)params[0];
			jsonObject = myHttpAPI.requestForJson(bean.getJsonObject());
		}catch (Exception e) {
			e.printStackTrace();
			return jsonObject;
		}
		
		return jsonObject;
	}
}
